<%@include file="/common/taglibs.jsp" %>
<html>
<head>
<%@include file="/common/scripts.jsp" %>
<script type="text/javascript">
$(function(){
	$("#theForm").validate({rules: {
	    pwd : {
	        required : true,
	    },
	    newPwd : {
	        required : true,
	        minlength : 8,
	        pwd : true
	    },
	    againPwd : {
	        required : true,
	        equalTo : "#newPwd"
	    },	    
	}});
	$("#saveBtn").click(function(){
	   doSave(); 
	});
});
function doSave(callback) {
	$('#theForm').ajaxSubmit({
		url:"save",
		beforeSubmit:function(){
			var rtnVal = $("#theForm").valid();
			return rtnVal;
		},
		success:function(data, statusText, xhr, $form){
			alert(data.message);
			if (data.success) {
			    if (callback.success) {
			        callback.success();
			    }
			}
		},
		dataType:'json'
	});
}
</script>
</head>
<body>
    <div class="pageOuter">
        <!--body content-->
        <div class="contentOuter">
            <div class="blockBorder">
                <form action="save" name="theForm" id="theForm" method="post">
                    <table class="queryForm">
                        <tr>
                            <td width="30%"><span class="required">*</span>
                            <fmt:message key='label.home.pwd.jsp.pwd.old' />:</td>
                            <td width="70%"><input type="password" name="pwd" id="pwd" class="required" style="width: 70%;" maxlength="20"/></td>
                        </tr>
                        <tr>
                            <td width="30%"><span class="required">*</span>
                            <fmt:message key='label.home.pwd.jsp.pwd.new' />:</td>
                            <td width="70%"><input type="password" name="newPwd" id="newPwd" class="required" style="width: 70%;" maxlength="20"/></td>
                        </tr>                                                                                                         
                        <tr>
                            <td width="30%"><span class="required">*</span>
                            <fmt:message key='label.home.pwd.jsp.pwd.again' />:</td>
                            <td width="70%"><input type="password" name="againPwd" id="againPwd" class="required" style="width: 70%;" maxlength="20"/></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</body>
<!--pageOuter end-->
</html>
